import 'package:flutter/material.dart';

class LoadingIndicator extends StatelessWidget {
  final bool isLoading;
  final bool isEmpty;
  final String emptyText;
  final String endText;

  const LoadingIndicator({
    super.key,
    required this.isLoading,
    required this.isEmpty,
    this.emptyText = '没有找到相关内容',
    this.endText = '已经到底了',
  });

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(8.0),
      child: Center(
        child: isLoading
            ? const CircularProgressIndicator()
            : isEmpty
                ? Text(emptyText, style: const TextStyle(color: Colors.white))
                : Text(endText, style: const TextStyle(color: Colors.white)),
      ),
    );
  }
}